import 'package:flutter/material.dart';
import 'package:flutter_ahj_app/base/utils/JUIKit/JText.dart';
import 'package:flutter_ahj_app/app/my/invoicing/ChooseFaPiaoNeiRong/bean/FP_PresetInvoice_Bean.dart';

typedef VoidCallback = void Function();

class ItemView extends StatefulWidget {
  final VoidCallback voidCallback;
  final Data data;

  const ItemView({Key key, this.voidCallback, this.data}) : super(key: key);
  @override
  _ItemViewState createState() => _ItemViewState();
}

class _ItemViewState extends State<ItemView> {
  ///是否选中
  bool _isSelected = false;
  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.fromLTRB(10, 10, 10, 0),
      child: Card(
        child: ListTile(
          title: JText("开票内容："+widget.data?.typeName ?? ''),
          subtitle: JText("开票税率："+widget.data?.taxPoint ?? ''),
          onTap: () => _selectEve(),
        ),
      ),
    );
  }

  /// 选择
  _selectEve() {
    print('选择');

    if (widget.voidCallback != null) {
      widget.voidCallback();
    }
  }
}
